package com.example.mrzhou.lvmm.model.impl;

import com.example.mrzhou.lvmm.api.RetroManager;
import com.example.mrzhou.lvmm.api.SurroundService;
import com.example.mrzhou.lvmm.entity.surround.holiday.Holiday;
import com.example.mrzhou.lvmm.entity.surround.hotel.Hotel;
import com.example.mrzhou.lvmm.entity.surround.scenic.Scenic;
import com.example.mrzhou.lvmm.model.ISurModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Mr.zhou on 2016/10/27.
 */

public class SurModelImpl implements ISurModel {

    @Override
    public void getScenicData(Map<String, String> parmas, Subscriber<Scenic> subscriber) {
        RetroManager.getInstance(SurroundService.BASEURL)
                .getSurService()
                .getScenicData(parmas)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getHotelData(Map<String, String> parmas, Subscriber<Hotel> subscriber) {
        RetroManager.getInstance(SurroundService.BASEURL).getSurService().getHotelData(parmas)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getHolidayData(Map<String, String> parmas, Subscriber<Holiday> subscriber) {
        RetroManager.getInstance(SurroundService.BASEURL).getSurService().getHolidayData(parmas)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);

    }


}
